﻿using System;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Routing;
using Ant.WarmupStarter;

namespace MvcWeb
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode,
    // visit http://go.microsoft.com/?LinkId=9394801
    public class MvcApplication : HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            //PlugInConfig.RegisterPlugIns();
            Starter.Instance.OnApplicationStart(this);
        }

        protected void Application_BeginRequest()
        {
            Starter.Instance.OnBeginRequest(this);
        }

        protected void Application_AcquireRequestState()
        {
            Starter.Instance.OnAcquireRequestState(this);
        }

        protected void Application_EndRequest()
        {
            Starter.Instance.OnEndRequest(this);
        }

        protected void Application_Error()
        {
            Starter.Instance.OnError(this);
        }

        protected void Session_Start(object sender, EventArgs e)
        {
            Starter.Instance.OnSessionStart(sender, e);
        }
    }
}